inspired by Ion Andreescu